import React from 'react';
import styles from './UserLayout.less';
import { useStaticState } from '@/utils';
import renovate from '@/utils/renovate';
import TSwiper from '@/components/TSwiper';
import img1 from '@/assets/img/01@2x.jpg';
import img2 from '@/assets/img/02@2x.jpg';
import img3 from '@/assets/img/03@2x.jpg';
import img4 from '@/assets/img/04@2x.jpg';

const UserLayout = (props) => {
  const staticState = useStaticState({
    swiperProps: {
      arrows: true,
      autoplay: true,
      dots: true,
      delay: 5,
      height: 560,
      items: [{ src: img1 }, { src: img2 }, { src: img3 }, { src: img4 }],
      speed: 0.5,
      width: 484,
    },
    copyrightTxt: '',
  });
  React.useEffect(() => {
    document.title = '交易辅助决策系统';
    renovate.isLOGOUT = true;
  }, []);

  return (
    <div className={styles.container}>
      <div>
        <div className={styles.content}>
          <div>
            <TSwiper {...staticState.swiperProps} />
          </div>
          <div>{props?.children}</div>
        </div>
        <div className={styles.copyright}>{staticState.copyrightTxt}</div>
      </div>
    </div>
  );
};

export default UserLayout;
